﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace XmlVisualizer.Dialogs {
	/// <summary>
	/// Interaction logic for DialogRange.xaml
	/// </summary>
	public partial class DialogRange : Window {
		private string returnValue = String.Empty;

		public DialogRange() {
			InitializeComponent();
		}

		public string ShowModal() {
			ShowDialog();
			return returnValue;
		}

		private void btnOK_Click(object sender, RoutedEventArgs e) {
			string res = tbRange.Text.Trim();
			returnValue = res;
			Close();
		}

		/// <summary>
		/// Invoked when window gets activated.
		/// </summary>
		/// <param name="e">The event data.</param>
		protected override void OnActivated(EventArgs e) {
			base.OnActivated(e);

			tbRange.Focus();
		}
	}
}
